﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Prueba.ViewModel.Utils;
using System.Windows;
using Prueba.ViewModel;

namespace Nav3
{
    public class HelperSaveDialog:ViewModelBase, IWaitMessage
    {
        private DlgSave ds;
        public bool JobDone
        {
            get { return _JobDone; }
            set
            {
                if (_JobDone != value)
                {
                    _JobDone = value;
                    OnPropertyChanged(JobDonePropertyName);
                }
            }
        }
        private bool _JobDone;
        public const string JobDonePropertyName = "JobDone";

        public void Show()
        {
            ds = new DlgSave();
            ds.DataContext = this;
            this.JobDone = false;

            try
            {
                Window w = Application.Current.Windows[0];
                ds.Owner = w;
            }
            catch (Exception)
            {
                ;
            }

            ds.ShowDialog();
        }

        public void Hide()
        {
            this.JobDone = true;
        }
    }
}
